package cn.edu.njust.mapper;

import cn.edu.njust.pojo.Result;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * -*- coding: UTF-8 -*-
 *
 * @Project: CCF-Pre-Registration-System
 * @Package: cn.edu.njust.mapper
 * @IDE: IntelliJ IDEA
 * @File: ResultMapper.java
 * @Author: GZ-WangSong
 * @Date: 2022/12/29 22:56
 * @Description:
 */
public interface ResultMapper {
    @Select("select * from pre_registration_system.result where id_no != '111'")
    @ResultMap("resultResultMap")
    List<Result> selectAllResult();

    @Insert("insert into pre_registration_system.result (re_no,id_no,language,year,Q1_grade,Q2_grade,Q3_grade,Q4_grade,Q5_grade,grade) " +
            "values (#{reNo},#{idNo},#{language},#{year},#{Q1_grade},#{Q2_grade},#{Q3_grade},#{Q4_grade},#{Q5_grade},#{grade})")
    void add(Result result);
}
